﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace SoSlam.Common.ClientLogic
{
    public static class DrawStringHelper
    {
        public static void DrawCenteredString(this SpriteBatch spriteBatch, SpriteFont spriteFont, string text, Vector2 position, Color color)
        {
            var measuredText = spriteFont.MeasureString(text);
            spriteBatch.DrawString(
                            spriteFont,
                            text,
                            position - measuredText / 2, 
                            color);
        }
    }
}
